{if (! $Request.isPjax)}
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <title> - 管理后台</title>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="Content-Language" content="zh-CN">
    <!--<link rel="shortcut icon" href="/favicon.ico">-->
{/* 载入框架&插件CSS */}
    {load href="__libs__/layer/skin/layer.css"/}
    {load href="__libs__/amaze/css/amazeui.min.css"/}
    {load href="__libs__/datetime/datetimepicker.min.css"/}
    {load href="__libs__/select2/css/select2.min.css"}
    {load href="__libs__/uploader/webuploader.css"/}
{/* 载入框架&插件JS */}
    {load href="__libs__/notify.js"/}
    {load href="__libs__/jquery/jquery.min.js"/}
    {load href="__libs__/layer/layer.js"/}
    {load href="__libs__/amaze/js/amazeui.min.js"/}
    {load href="__libs__/tree/amazeui.tree.min.js"/}
    {load href="__libs__/moment/moment.min.js"/}
    {load href="__libs__/datetime/datetimepicker.min.js"/}
    {load href="__libs__/select2/js/select2.min.js"}
    {load href="__libs__/uploader/webuploader.nolog.js"/}
{/* 载入项目 CSS & JS */}
    {load href="__style__/admin/common.css"/}
    {load href="__style__/admin/reload.css"/}
    {load href="__script__/admin/functions.js"/}
    {load href="__script__/admin/message.js"/}
    {load href="__script__/admin/pjax.js"/}
    {load href="__script__/admin/common.js"/}
</head>
<body>
{assign name="menus" value=":build_menus()"/}
<div id="layout-north">
    <a id="layout-logo" href="{:url('admin/index/index')}" data-pjax>后台管理系统</a>
    {if $menus['group_switch']}
    <ul id="layout-nav" class="am-nav am-nav-pills">
        {foreach $menus['group'] as $gn => $gv}
        <li class="{if $gn=='main'}am-active{/if}">
            <a href="javascript:;" data-group-menus="#group-{$gv.group}">
                <i class="{$gv.icon}"></i> {$gv.label}
            </a>
        </li>
        {/foreach}
    </ul>
    {/if}
    <ul id="layout-tools" class="am-nav am-nav-pills">
        <li>
            <a href="{:url('admin/login/logout')}" class="safe-exit">
                <i class="am-icon-power-off"></i> 安全退出
            </a>
        </li>
    </ul>
</div>
<div id="layout-west">
    <div id="layout-menus">
        <div id="layout-menus-info" class="am-dropdown" data-am-dropdown>
            <a class="am-dropdown-toggle" href="javascript:;" data-am-dropdown-toggle>
                <img src="__image__/admin/avatar.png" alt="..." class="avatar am-circle">
                <span class="profile am-text-center">欢迎回来</span>
                <span class="handle am-text-center">
                    <i class="am-fl am-icon-user"></i>
                    {$admin.realname}
                    <i class="am-fr am-icon-caret-down"></i>
                </span>
            </a>
            <ul class="am-dropdown-content">
                <li><a href="{:url('admin/profile/info')}" data-pjax><i class="am-icon-user"></i> 个人资料</a></li>
                <li><a href="{:url('admin/profile/login')}" data-pjax><i class="am-icon-tasks"></i> 登录日志</a></li>
                <li class="am-divider"></li>
                <li>
                    <a href="{:url('admin/login/logout')}" class="safe-exit">
                        <i class="am-icon-power-off"></i> 安全退出
                    </a>
                </li>
            </ul>
        </div>
        <div id="layout-menus-lists">
            {/* 创建菜单生成闭包 */}
            {function name="func_build_menus" vars="$menus,$gn,$gv"}
                {if $gn == "main"}
                <li class="menu-item">
                    <a href="{:url('admin/index/index')}" data-pjax>
                        <i class="menus-icon am-icon-home"></i> 首页
                    </a>
                </li>
                {/if}
                {foreach $menus[$gv['group']] as $m => $mv}
                {if ! isset($mv['items'])}
                <li class="menu-item">
                    <a href="{$mv.link|url=###}" data-pjax>
                        <i class="menus-icon {$mv.icon}"></i> {$mv.label}
                    </a>
                </li>
                {else/}
                <li class="menu-group am-panel">
                    <a href="javascript:;" data-am-collapse="{parent: '#group-{$gv.group}', target: '#{$gv.group}-{$m}'}">
                        <i class="menus-icon {$mv.icon}"></i> {$mv.label}
                        <i class="am-icon- am-fr"></i>
                    </a>
                    <ul class="sub-menus am-list am-collapse" id="{$gv.group}-{$m}">
                        {foreach $mv['items'] as $item}
                        <li class="menu-item">
                            <a href="{$item.link|url=###}" data-pjax>
                                <i class="am-icon-chevron-right"></i> {$item.label}
                            </a>
                        </li>
                        {/foreach}
                    </ul>
                </li>
                {/if}
                {/foreach}
            {/function}
            {/* 构建菜单列表 */}
            {if $menus['group_switch']}
            {foreach $menus['group'] as $gn => $gv}
            <ul id="group-{$gv.group}" class="group-menus am-list {if $gn!='main'}am-hide{/if}">
                {:$func_build_menus($menus, $gn, $gv)}
            </ul>
            {/foreach}
            {else/}
            <ul id="group-main" class="group-menus am-list">
            {foreach $menus['group'] as $gn => $gv}
                {:$func_build_menus($menus, $gn, $gv)}
            {/foreach}
            </ul>
            {/if}
        </div>
    </div>
</div>
<div id="layout-center">
    <div id="layout-main">
{/if}